package cn.gxljc.technology.store_management.service.dao.mapper;

import cn.gxljc.technology.store_management.entity.WarehouseStock;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 功能：主要用于业务操作的数据库交互
 * 作者：7214
 */
@Mapper
public interface ServiceMapper {

    /**
     * ------------------------------------库存模块----------------------------------------
     * 库存模块
     * 1.根据仓库、增加库存
     * 2.根据仓库、删除库存
     * 3.根据仓库、查找所有库存
     * 4.根据仓库、查找特定的库存
     * 5.根据仓库、查看特定的仓库是否存在(通过已有的接口可实现)
     * 6.根据仓库和所对应的库存修改基本信息
     */

    /*  private int warehouseID;
  private int wareID;
  private int wareCount;*/

    //1
    @Insert("insert into warehousestock value(#{warehouseID},#{wareID},#{wareCount})")
    void insertStockIntoRepository(@Param("wareID") Integer wareID, @Param("wareCount") Integer wareCount, @Param("warehouseID") Integer warehouseID);

    //2
    @Delete("delete from warehousestock where wareID = #{wareID}")
    Integer deleteStockFromRepository(Integer ware);

    //3
    List<WarehouseStock> findAllStockFromRepository();

    //4
    WarehouseStock findStockFromRepositoryByGoodsName();

    //6
    Integer changeStockInfoFromRepository();

    /**--------------------------------------库存模块-------------------------------------/*/

}
